#encoding:gbk

def tsms():
	import MySQLdb
	db=MySQLdb.connect(user='root',db='mas',passwd='*F5E898254C2414B85A8BACD95C9892B08832207A',host='210.31.48.98',port=1221)
	cursor=db.cursor()
	cursor.execute("set NAMES GBK")  
	cursor.execute("insert into sms_outbox(EXTCODE,DESTADDR,MESSAGECONTENT,REQDELIVERYREPORT,MSGFMT,SENDMETHOD,REQUESTTIME,APPLICATIONID) values('10657500053002','13810578644','test02',1,0,2,now(),'P000000000008001')")
	db.close()


def tsmsd():
	import MySQLdb
	db=MySQLdb.connect(user='root',db='mas',passwd='',host='210.31.48.98',port=1221)
	cursor=db.cursor()
	cursor.execute("set NAMES GBK")  
	cursor.execute("insert into sms_outbox(EXTCODE,DESTADDR,MESSAGECONTENT,REQDELIVERYREPORT,MSGFMT,SENDMETHOD,REQUESTTIME,APPLICATIONID) values('10657500053002','13810578644','test070305',1,0,2,now(),'P000000000008001')")
	db.close()

def sendsms(tel,cstr):
	import MySQLdb
	db=MySQLdb.connect(user='root',db='mas',passwd='',host='210.31.48.98',port=1221,charset='gbk')
	cursor=db.cursor()
	sqlstr="""insert into sms_outbox(EXTCODE,DESTADDR,MESSAGECONTENT,REQDELIVERYREPORT,MSGFMT,SENDMETHOD,REQUESTTIME,APPLICATIONID) values('10657500053002',\'%s\',\'%s\',1,0,2,now(),'P000000000008001')""" %(tel,cstr)
	cursor.execute(sqlstr)	

	db.commit()
	db.close()


def sendsmst(table,tel,cstr):
	import MySQLdb
	db=MySQLdb.connect(user='root',db='mas',passwd='',host='210.31.48.98',port=1221,charset='gbk')
	cursor=db.cursor()
	sqlstr="""insert into %s(EXTCODE,DESTADDR,MESSAGECONTENT,REQDELIVERYREPORT,MSGFMT,SENDMETHOD,REQUESTTIME,APPLICATIONID) values('10657500053002',\'%s\',\'%s\',1,0,2,now(),'P000000000008001')""" %(table,tel,cstr)
	cursor.execute(sqlstr)	

	db.commit()
	db.close()



def tsmsg():
	import MySQLdb
	db=MySQLdb.connect(user='root',db='mas',passwd='',host='210.31.48.98',port=1221,charset='gbk')
	cursor=db.cursor()
	cursor.execute("insert into sms_outbox(EXTCODE,DESTADDR,MESSAGECONTENT,REQDELIVERYREPORT,MSGFMT,SENDMETHOD,REQUESTTIME,APPLICATIONID) values('10657500053002','13810578644','testDAY01',1,0,2,now(),'P000000000008001')")
	db.commit()
	db.close()


def tsmsgi():
	import MySQLdb
	db=MySQLdb.connect(user='root',db='mas',passwd='',host='210.31.48.98',port=1221,charset='gbk')
	cursor=db.cursor()
	cursor.execute("insert into sms_outbox(EXTCODE,DESTADDR,MESSAGECONTENT,REQDELIVERYREPORT,MSGFMT,SENDMETHOD,REQUESTTIME,APPLICATIONID) values('10657500053002','13810578644','testDAY01',1,0,2,'2014-07-03 16:29:01','P000000000008001')")
	db.close()

def tsdemo():
	import MySQLdb
	db=MySQLdb.connect(user='root',db='mas',passwd='',host='210.31.48.98',port=1221,charset='gbk')
	cursor=db.cursor()
	cursor.execute("insert into testsms(EXTCODE,DESTADDR,MESSAGECONTENT,REQDELIVERYREPORT,MSGFMT,SENDMETHOD,REQUESTTIME,APPLICATIONID) values('10657500053002','13810578644','testDAY01',1,0,2,now(),'P000000000008001')")
	db.commit()
	db.close()

def tsdemono():

	import MySQLdb
	db=MySQLdb.connect(user='root',db='mas',passwd='',host='210.31.48.98',port=1221,charset='gbk')
	cursor=db.cursor()
	cursor.execute("insert into testsms(EXTCODE,DESTADDR,MESSAGECONTENT,REQDELIVERYREPORT,MSGFMT,SENDMETHOD,REQUESTTIME,APPLICATIONID) values('10657500053002','13810578644','testDAY01',1,0,2,now(),'P000000000008001')")
	#db.commit()
	db.close()


